<@page currentChannel="JOB" title="我的简历" useheader="default" assets=["/css/site/base-form.css","/css/components/matchbox.css", "/up/resume/css/global.css","/up/resume/css/resume.css","/up/job-project-2013/css/verify-phone.css","/js/jquery.formvalidatefn.js","/js/jquery.ajax-limit.js", "/js/jquery.formvalidate.js", "/js/jquery.linkup.js", "/up/resume/js/misc.js","/up/resume/js/jquery.ui.core.js","/up/resume/js/jquery.ui.widget.js","/up/resume/js/jquery.ui.mouse.js","/up/resume/js/jquery.ui.sortable.js","/up/job-project-2013/js/verify-phone.js"]>
<div id="content">
    <#include "/WEB-INF/ftl/job/navigation.ftl">
    <@navigation 'resume' />
    <#include "/WEB-INF/ftl/job/subsubnavigation.ftl"/>
    <@subsubnavigation 'editresume'/>
    <#if hasMsg?? && hasMsg>
        <div class="tips-normal creat-success">创建简历成功！</div>
        <script type="text/javascript">
            setTimeout(function(){
                $('.creat-success').hide();
                modelTip()
            },2000)
        </script>
    </#if>
    <div class="resume-main clearfix">
        <div class="sidecolumnwrap">
            <div class="sidecolumn">
                <script type="text/javascript">
                    loadLayout();
                </script>
            </div>
            <div class="p-for-edu-ad">
                <a target="_blank" href="http://edu.dajie.com/source/zt/jz.html">
                    <img src="http://${configs['domains.assets']}/up/resume/images/edu-ad.jpg">
                </a>
            </div>
        </div>
        <div class="maincolumn border-bottom">
            <div class="item-section">
                <div class="mask-area">
                    <h3>
                        <a href="#" class="edit-btn J_editBase" rel="base" itemtype="base" itemid="${(resumeHelper.basic().uid)!}">编辑</a><span class="b f14">基本信息</span>
                    </h3>
                    <div class="item-bd">
                        <div class="info-area clearfix" id="base-info">
                            <#include "frag_basic.ftl">
                        </div>
                    </div>
                </div>
            </div>
            <div class="item-section">
                <div class="mask-area">
                    <h3>
                        <a href="#" class="edit-btn J_editBase" rel="contact" itemtype="contact" >编辑</a><span class="b f14">联系方式</span>
                    </h3>
                    <div class="item-bd">
                        <div class="info-area" id="contact-info">
                            <#include "frag_contact.ftl">
                        </div>
                    </div>
                </div>
            </div>
            <#list models as model>
                <#if model !='' && model != 'photo'>
                    <div class="item-section">
                        <div class="mask-area">
                            <h3>
                                <#assign type = "add"/>
                                <#if model == 'itskill'>
                                    <#if resumeHelper.itskills()?? && resumeHelper.itskills()?size &gt; 0>
                                        <#assign type = "edit"/>
                                    </#if>
                                </#if>
                                <#if model == 'cert'>
                                    <#if resumeHelper.certs()?? && resumeHelper.certs()?size &gt; 0>
                                        <#assign type = "edit"/>
                                    </#if>
                                </#if>
                                <a href="#"  class="${type}-btn J_event" itemType="${model}" rel="${type}" maxnum="${resume.maxSize(model)}"><#if type == "add">添加<#else>编辑</#if></a><span class="b f14"><@modelname name="${model}"/></span>
                            </h3>
                            <div class="item-bd">
                                <#if model = 'edu'>
                                    <#assign num= resumeHelper.edus()?size/>
                                <#elseif model == 'practice'>
                                    <#assign num = resumeHelper.practices()?size/>
                                <#else>
                                    <#assign num = resumeHelper.interns()?size/>
                                </#if>
                                <#if (model == 'edu' || model == 'practice' || model == 'intern') && num < 10>
                                    <div id="${model}-tip" class="tips-normal include-tip syn-tip" style="display: none" num="${num}"><span class="span-icon">档案中有新的<@modelname name="${model}"/>未同步至简历，<a href="javascript:void(0);" class="t-color syn-model" item=${model}>马上同步</a></span></div>
                                </#if>
                                <div id="${model}-info" class="info-area">
                                    <#assign frag_ftl = "frag_${model}.ftl" />
                            <#include frag_ftl>
                                </div>
                            </div>
                        </div>
                    </div>
                </#if>
            </#list>

        </div>
    </div>
</div>

<script type="text/javascript">
    $(function(){
        hiddenAddBtn($('.J_event[rel="add"]'));
        $.ajax({
            type:'post',
            url:'/resume/sync/showTips',
            success:function(r) {
                var result = r.split(":");
                if(result[0]==1){
                    var model = result[1].split(",");
                    if(model[0] == 1){
                        $('#edu-tip').show();
                    }else{
                        $('#edu-tip').remove();
                    }
                    if(model[1] == 1){
                        $('#practice-tip').show();
                    }else{
                        $('#practice-tip').remove();
                    }
                    if(model[2] == 1){
                        $('#intern-tip').show();
                    }else{
                        $('#intern-tip').remove();
                    }
                }
            }
        });
        $('.syn-model').live('click', function(){
            var model = $(this).attr('item'),
                    html =null;
            $.ajax({
                type:'post',
                url:'/resume/sync/'+model,
                success:function(r){
                    var result = eval('('+ r + ')');
                    if(result.statusCode == 0){
                        html = result.data;
                        $('#include-practice').remove();
                        $('body').append(html);
                        $.dialog('#include-practice', {mask: true, mercy:false, title: '从档案导入',customClass:'include-dialog',defbtn:false, width:600, mercy: false,oncomplete:function(){
                            var $form = $('#syn-form');
                            $.ajaxLimit({
                                url : $form.attr('action'),
                                type : $form.attr('method').toUpperCase(),
                                data :$form.serialize(),
                                success:function(r) {
                                    var result = eval('(' + r + ')');
                                    if (result.statusCode == 0) {
                                        $('#'+ model+'-tip').remove();
                                        resultForm(model, result.data);
                                        $('#interactive-box-include-practice').remove();
                                        loadLayout();
                                    } else {
                                        alert(result.msg);
                                    }
                                }
                            });
                        },
                            onabort:function(){
                                $('#interactive-box-include-practice').remove();
                            }
                        })
                    }
                }
            })
        })
    })

</script>

    <#macro modelname name><#if name ='edu'>
        <#assign modelName = '教育经历'/>
    <#elseif name ='lang'>
        <#assign modelName = '语言能力'/>
    <#elseif name ='cert'>
        <#assign modelName = '证书'/>
    <#elseif name ='itskill'>
        <#assign modelName = 'IT技能'/>
    <#elseif name ='project'>
        <#assign modelName = '项目经验'/>
    <#elseif name ='training'>
        <#assign modelName = '培训经历'/>
    <#elseif name ='practice'>
        <#assign modelName = '工作经历'/>
    <#elseif name ='intern'>
        <#assign modelName = '实习经历'/>
    <#elseif name ='offer'>
        <#assign modelName = '求职经历'/>
    <#elseif name ='other'>
        <#assign modelName = '其他信息'/>
    <#elseif name ='scholarship'>
        <#assign modelName = '校内奖励'/>
    <#elseif name ='affix'>
        <#assign modelName = '附件/作品'/>
    <#elseif name ='position'>
        <#assign modelName = '校内职务'/>
    </#if>${modelName!""}</#macro>

</@page>